#include <iostream>
using namespace std;

//把长w,宽h的蛋糕分成m块，并把最大蛋糕下限返回
int CutCake(int w,int h,int m){
    //如果刚好整除，直接返回结果
    if( w*h%m==0 ){
        return w*h/m;
    }else{
        int a=w*h/m;
        while( 1){
            if( a%w ==0 ) return CutCake(w,h-(a/w),m-1);
            if( a%h ==0 ) return CutCake(w-(a/h),h,m-1);
            --a;
        }
    }
}
int main(){
    freopen("in.txt","r",stdin);
    freopen("out.txt","w",stdout);
    int w,h,m;
    while( cin>>w>>h>>m ){
        if( w==0&& h==0 &&m==0 ){
            break;
        }else{
            int k = CutCake(w,h,m);
            cout<<k<<endl;
        }
    }
    return 0;
}
